package com.yqd.d1_encapsulation.demo2;

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class MainTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入要查找的姓名：");
        String name = scanner.next();
        List<String> names = Arrays.asList("tom", "jack", "rose");
        if (names.contains(name)) {
            System.out.println("找到此人");
        } else {
            System.out.println("查无此人");
        }
    }
}
